﻿/**
 * @file   FITKAbaqusAdaptorConnectorStopBehavior.h
 * @brief 连接器停止行为 适配器
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date 2024-06-26
 */
#ifndef __FITKABAQUSADAPTORCONNECTORSTOPBEHAVIOR__H__
#define __FITKABAQUSADAPTORCONNECTORSTOPBEHAVIOR__H__

#include "FITKAbaqusAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

ForwardDeclarNS(Interface, FITKAbaConnectorSection)
ForwardDeclarNS(Interface, FITKAbaConnectorBehaviorStop)

namespace IO
{
    /**
     * @brief 连接器停止行为 读写适配器
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-06-20
     */
    class FITKAbaqusAdaptorConnectorStopBehavior : public FITKAbaqusAbstractAdaptor
    {
    public:
        explicit FITKAbaqusAdaptorConnectorStopBehavior() = default;
        ~FITKAbaqusAdaptorConnectorStopBehavior() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-20
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-20
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-20
         */
        bool adaptW() override;

        /**
         * @brief 设置写出的行为数据
         * @param[i] stopData Interface::FITKAbaConnectorBehaviorStop*
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-27
         */
        void setWriteBehaviorData(Interface::FITKAbaConnectorBehaviorStop* stopData);

    private:
        /**
         * @brief 读取stop的数据
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-07-01
         */
        bool readStopData();
        /**
         * @brief 写出stop动作
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-07-01
         */
        bool writeStopBehavior();

    private:
        /**
         * @brief 连接器数据
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-24
         */
        Interface::FITKAbaConnectorSection* _sectionConnectorData{};
        /**
         * @brief 连接器停止行为数据
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-26
         */
        Interface::FITKAbaConnectorBehaviorStop* _stopBehaviorData{};
        /**
         * @brief 组件（力矩）的选项
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-27
         */
        int _component{ 0 };
    };
    Register2FITKIOAdaptorFactory(INP, Interface::FITKAbaConnectorBehaviorStop, FITKAbaqusAdaptorConnectorStopBehavior)
}

#endif